<?php

/**
 * 后台 文档 模块 Model
 * ============================================================================
 * TBlog TBlog博客系统　BY Tmac PHP MVC framework
 * $Author: zwt007 $  <zwttmac@qq.com>
 * $Id: archives.class.php 31 2011-07-11 15:25:51Z zwt007 $
 * http://www.t-mac.org；
 */
class archives extends Model
{

    private $class_table;
    private $article_table;
    private $category_model;

    /**
     * 初始化变量　定义私有变量
     */
    public function _init()
    {
        //连接数据库
        $this->connect();
        $this->class_table = '#@__category';
        $this->article_table = '#@__article';
        $this->category_model = Tmac::model('category');
    }

    /**
     * 检测频道ID
     * @param <type> $cat_id
     * @param <type> $channelid
     * @return <type>
     */
    public function checkChannel($cat_id, $channelid)
    {
        $cat_info = $this->category_model->getCategoryInfo($cat_id);
        if ($cat_info['channeltype'] != $channelid) {
            return false;
        } else {
            return true;
        }
    }

}